package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;

import java.util.Objects;

public class UserPatronsSkill extends DataObject {

	private long userId;

	private int patronsId;

	private int skillId;

	private int skillLv;

	private int type;

	private int skinSkillLevel;

	private int isDelete;

	/**
	 * 额外参数，（type为蛐蛐技能-蛐蛐技能突破次数）
	 */
	private String extraParams;

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		if(this.userId != userId) {
			this.userId = userId;
			setUpdateOption();
		}
	}

	public int getPatronsId() {
		return patronsId;
	}

	public void setPatronsId(int patronsId) {
		if(this.patronsId != patronsId) {
			this.patronsId = patronsId;
			setUpdateOption();
		}
	}

	public int getSkillId() {
		return skillId;
	}

	public void setSkillId(int skillId) {
		if(this.skillId != skillId) {
			this.skillId = skillId;
			setUpdateOption();
		}
	}

	public int getSkillLv() {
		return skillLv;
	}

	public void setSkillLv(int skillLv) {
		if(this.skillLv != skillLv) {
			this.skillLv = skillLv;
			setUpdateOption();
		}
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		if(this.type != type) {
			this.type = type;
			setUpdateOption();
		}
	}

	public int getSkinSkillLevel() {
		return skinSkillLevel;
	}

	public void setSkinSkillLevel(int skinSkillLevel) {
		if (this.skinSkillLevel != skinSkillLevel) {
			this.skinSkillLevel = skinSkillLevel;
			setUpdateOption();
		}
	}

	public int getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(int isDelete) {
		if (this.isDelete!=isDelete){
			this.isDelete = isDelete;
			setUpdateOption();
		}
	}

	public int getTotalSkillLevel() {
		return skillLv + skinSkillLevel;
	}

	public String getExtraParams() {
		return extraParams;
	}

	public void setExtraParams(String extraParams) {
		if (!Objects.equals(this.extraParams, extraParams)){
			this.extraParams = extraParams;
			setUpdateOption();
		}
	}

	public UserPatronsSkill cloneUserPatronsSkill() {
		UserPatronsSkill copyUserPatronsSkill = new UserPatronsSkill();
		copyUserPatronsSkill.setUserId(userId);
		copyUserPatronsSkill.setPatronsId(patronsId);
		copyUserPatronsSkill.setSkillId(skillId);
		copyUserPatronsSkill.setSkillLv(skillLv);
		copyUserPatronsSkill.setType(type);
		copyUserPatronsSkill.setSkinSkillLevel(skinSkillLevel);
		copyUserPatronsSkill.setExtraParams(extraParams);
		copyUserPatronsSkill.setIsDelete(isDelete);
		return copyUserPatronsSkill;
	}
}
